#!/bin/sh

[ "$ACTION" = ifup ] || exit 0

device=$(uci get shadowvpn.@shadowvpn[-1].device_save 2>/dev/null)

[ -n "$device" -a "$DEVICE" = "$device" ] || exit 0

/etc/init.d/shadowvpn restart
logger -t ShadowVPN "Restart ShadowVPN due to ifup of $INTERFACE ($DEVICE)"
